package com.orangelife.service.propinfo.impl;

import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.locks.ReadWriteLock;
import java.util.concurrent.locks.ReentrantReadWriteLock;



/**
 * 
 * 产权信息同步
 * */
public class SyncPropInfoService {
	private String commID;
	 private ReadWriteLock rwl = new ReentrantReadWriteLock();    
	private ConcurrentHashMap<String,ITaskService> taskServices=new ConcurrentHashMap<>();
	private ConcurrentHashMap<String,String> updateFlag=new ConcurrentHashMap<>();
     private ConcurrentHashMap<String,Integer> tasks=new ConcurrentHashMap<>();
	
	//添加任务
	public void addTask(String taskName){
		
		
		tasks.put(taskName, 1);

		
	}
	//处理任务
	public void syncData(){
		
		
		
		
	}
	
	
	public ITaskService getTaskService(String taskName){
		if(taskServices.get(taskName)==null){
			
	synchronized(this){
				
		if(taskServices.get(taskName)==null){
			
				ITaskService i=	createTaskService(taskName);
				
				taskServices.put(taskName, i)	;
		}
				
			}
			
		
			
		}
		return taskServices.get(taskName);	
		
	}
	
	public ITaskService createTaskService(String taskName){
	switch (taskName) {
	case "apartment":
		
		
		break;

	default:
		break;
	}
		
		
		return null;
	};
	
//    class  
	 
	

}
